package com.steshov.Everything.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.steshov.Everything.dao.UserDao;
import com.steshov.Everything.entity.User;
import com.steshov.Everything.util.DataBaseException;

@Service
public class UserService {

	@Autowired
	UserDao userDao;

	public UserService() {
	}

	public User authorized(String login, String pass) throws DataBaseException {
		return userDao.authorized(login, pass);
	}

	public Boolean createuser(User user) throws DataBaseException {
		return userDao.createUser(user);
	}
	
	public User getUserByLogin(String login) throws DataBaseException {
		return userDao.getUserByLogin(login);
	}

	public UserDao getDao() {
		return userDao;
	}

	public void setDao(UserDao dao) {
		this.userDao = dao;
	}

}
